<template>
  <div class='AddModule'>
    <!-- 增加模块 -->
    <div class="item-form add-module">

      <ResumeModule
        v-for="mod in allModule"
        :allModule="allModule"
        :key="mod.id"
        v-show="!mod.isShow"
        @delModule="mod.isShow = true"
      >
        <!-- 名称 -->
        <template #title>
          <span>{{mod.value}}</span>
        </template>

      </ResumeModule>
      <!-- 兴趣爱好 -->

      <h3 class="title">增加模块</h3>
      <ul class="module-list">
        <li
          v-for="item of allModule"
          :key="item.id"
          v-show="item.isShow"
          @click="item.isShow = false"
        >
          <i class="el-icon-plus"></i>
          <p>{{ item.value }}</p>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import { addModule } from '../../../api/Job'
import ResumeModule from './ResumeModule.vue'
export default {
  name: 'AddModule',
  props: {},
  data () {
    return {
      allModule: [], // 所有模块
      textarea: ''
    }
  },
  components: {
    ResumeModule
  },
  computed: {},
  watch: {},
  created () {
    this.addModule()
  },
  mounted () {},
  methods: {
    async addModule () {
      const { data } = await addModule()
      data.map((v) => (v.isShow = true))
      this.allModule = data
    }
  }
}
</script>

<style lang="scss" scoped>
ul {
  margin: 0;
  padding: 0;
}
li {
  list-style: none;
}
.module-list li:hover {
  background: rgba(93, 213, 200, 0.05);
  border: 1px dashed #5dd5c8;
  color: #5dd5c8;
  cursor: pointer;
}
.module-list {
  display: flex;
  flex-wrap: wrap;
}
.module-list li {
  align-items: center;
  justify-content: center;
  border: 1px dashed #c1c6cc;
  border-radius: 1px;
  display: flex;
  height: 65px;
  line-height: 65px;
  margin: 0 13px 14px 0;
  opacity: 0.9;
  text-align: center;
  width: 200px;
}
.title {
  color: #12141a;
  font-family: PingFangSC-Semibold, PingFang SC;
  font-size: 20px;
  font-weight: 600;
  line-height: 33px;
  margin-bottom: 16px;
}
</style>
